#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:do_insert.py
# author:wmf
# datetime:2021/5/23 20:11
# software: PyCharm
'''
this is function description
'''
# import module your need
from homework10.homework10_2 import db


def dbDelete(name):
    cursor = db.cursor()

    sql = '''delete from test.student
             where name = '%s' ''' % name

    try:
        cursor.execute(sql)
        db.commit()
        print("删除成功!")
        db.close()
    except:
        db.rollback()
        db.close()


if __name__ == "__main__":
    dbDelete("李四")
